/******************************************************************************
 cnome: A C++ source "genes" discover. :-)

 See more details at:

   http://www.codeplex.com/cnome

 The original author site is at: http://www.alexandre-barbosa.com/

 Copyright (c) 2008 Alexandre Barbosa.
 Distributed under the MIT License. (See accompanying file LICENSE-MIT.txt 
 or at http://www.codeplex.com/cnome/license)
 ******************************************************************************/

#ifndef DERIVED_CLASSES_H
#define DERIVED_CLASSES_H

#include "actions.h"
#include "cnome.h"
#include "directives.h"
#include "tokens.h"

namespace cnome {
template <typename ScannerT>
void
cpp::definition<ScannerT>::derived_classes(cpp const& self)
    {
       using namespace actions;
       using namespace directive;
       using namespace util;

		base_clause =  
			COLON >> base_specifier_list
		;

		base_specifier_list =
			base_specifier >> base_specifier_list_helper
		;

		base_specifier_list_helper =
			( COMMA >> base_specifier >> base_specifier_list_helper ) |
			EPSILON
		;

		base_specifier =
				remain_tdc_d[
					last_remain_scope_d[
						(	sss_d[ !(COLON_COLON[&scopeIsAbsolut][&enter_scope]) 
							    >> !nested_name_specifier >> class_name ] ) ] ]
			|	remain_tdc_d[
					last_remain_scope_d[
						(	VIRTUAL >> !access_specifier 
							>> sss_d[ !(COLON_COLON[&scopeIsAbsolut][&enter_scope]) 
							       >> !nested_name_specifier >> class_name ] ) ] ]
			|	remain_tdc_d[
					last_remain_scope_d[
						(	access_specifier[&debug_point] >> !VIRTUAL 
							>> sss_d[ !(COLON_COLON[&scopeIsAbsolut][&enter_scope]) 
							       >> !nested_name_specifier >> class_name ] ) ] ]
		;

        access_specifier =
			PRIVATE   |
			PROTECTED |
			PUBLIC
		;
		//  End grammar definition
          
		// turn on the debugging info.
        BOOST_SPIRIT_DEBUG_RULE(base_clause);
		BOOST_SPIRIT_DEBUG_RULE(base_specifier_list);
        BOOST_SPIRIT_DEBUG_RULE(base_specifier);
        BOOST_SPIRIT_DEBUG_RULE(base_specifier_list_helper);
        BOOST_SPIRIT_DEBUG_RULE(nested_name_specifier);
        BOOST_SPIRIT_DEBUG_RULE(class_name);
        BOOST_SPIRIT_DEBUG_RULE(access_specifier);

        BOOST_SPIRIT_DEBUG_RULE(COLON);
        BOOST_SPIRIT_DEBUG_RULE(COMMA);
        BOOST_SPIRIT_DEBUG_RULE(COLON_COLON);
        BOOST_SPIRIT_DEBUG_RULE(VIRTUAL);
        BOOST_SPIRIT_DEBUG_RULE(EPSILON);
        BOOST_SPIRIT_DEBUG_RULE(PRIVATE);
        BOOST_SPIRIT_DEBUG_RULE(PROTECTED);
        BOOST_SPIRIT_DEBUG_RULE(PUBLIC);
	}
}  // namespace cnome
#endif // DERIVED_CLASSES_H
